#ifndef GENERAL_H
#define GENERAL_H

#include <QtGui/QWidget>
#include <QTextDocument>
#include "cdbprovider.h"
#include "WidgetTextEdit.h"

namespace Ui {
    class General;
}

class General : public QWidget {
    Q_OBJECT
    Q_DISABLE_COPY(General)
public:
    explicit General(QWidget *parent = 0);
    virtual ~General();

protected:
    virtual void changeEvent(QEvent *e);
    void loadList();
    void loadListTasks(int id);
    void loadTasksTester(int id);
    void saveTasksTester(int id);
    void clearAnswers();
    QList <QCheckBox *> wlist;
    QList <QWidget *> llist;
    QList <QWidget *> llistB;
    QList <QLineEdit *> wlistB;
    QTextDocument * tasksPrintForGroup(int id,QTextDocument *docs);
    QTextDocument * blankPrintForGroup(int idTasks,QTextDocument * docs);
    QString blankPrint(int id);

private:
    Ui::General *m_ui;
    CDBProvider *db;
    TextEdit *tb;
    TextEdit  *t;
    int cnt, bcnt;

    bool changedAnswer;

private slots:
    void on_viewPrintTasks_clicked();
    void on_treeWidget_currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous);
    void on_treeWidget_clicked(QModelIndex index);
    void on_pushButton_5_clicked();
    void on_pushButton_clicked();
    void on_pushButton_3_clicked();
    void on_treeWidget_itemClicked(QTreeWidgetItem* item, int column);
    void on_pushButton_2_clicked();
    void print(int type=0);
    void click_check(int state = 0);
};

#endif // GENERAL_H
